package net.mysoft.budgetsoft.system.domain;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * 
 * @author dagongPGP v1.0
 * @link <a href=http://www.mysoft.net>北京大公信软科技有限公司</a>
 * 
 * @version $Revision: 1.00 $Date: 2013-12-27 11:16:38
 */
//@Entity
//@Table(name = "GongNeng")
public class TGongNeng implements java.io.Serializable {
	private String bianHao;
	private String mingCheng;
	private String luJing;
	private Integer shunXuBH;
	private Integer zhuangTai;
	private Integer leiXing;
	private TGongNeng ptGongNeng;
	private Set<TGongNeng> ctGongNengSet;

	@Id
	@Column(name = "BianHao", unique = true, nullable = false)
	public String getBianHao() {
		return this.bianHao;
	}

	public void setBianHao(String bianHao) {
		this.bianHao = bianHao;
	}

	@Column(name = "MingCheng")
	public String getMingCheng() {
		return this.mingCheng;
	}

	public void setMingCheng(String mingCheng) {
		this.mingCheng = mingCheng;
	}

	@Column(name = "LuJing")
	public String getLuJing() {
		return this.luJing;
	}

	public void setLuJing(String luJing) {
		this.luJing = luJing;
	}

	@Column(name = "ShunXuBH")
	public Integer getShunXuBH() {
		return this.shunXuBH;
	}

	public void setShunXuBH(Integer shunXuBH) {
		this.shunXuBH = shunXuBH;
	}

	@Column(name = "ZhuangTai")
	public Integer getZhuangTai() {
		return this.zhuangTai;
	}

	public void setZhuangTai(Integer zhuangTai) {
		this.zhuangTai = zhuangTai;
	}

	@Column(name = "LeiXing")
	public Integer getLeiXing() {
		return this.leiXing;
	}

	public void setLeiXing(Integer leiXing) {
		this.leiXing = leiXing;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ShangJiBH")
	public TGongNeng getPtGongNeng() {
		return ptGongNeng;
	}

	public void setPtGongNeng(TGongNeng ptGongNeng) {
		this.ptGongNeng = ptGongNeng;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "ptGongNeng")
	public Set<TGongNeng> getCtGongNengSet() {
		return ctGongNengSet;
	}

	public void setCtGongNengSet(Set<TGongNeng> ctGongNengSet) {
		this.ctGongNengSet = ctGongNengSet;
	}

	@Override
	public int hashCode() {
		int prime = 0;
		prime += this.getBianHao().hashCode();
		return prime;
	}

	@Override
	public boolean equals(Object obj) {
		boolean isEquals = false;
		if (obj != null && this.getClass() == obj.getClass()) {
			TGongNeng clazz = (TGongNeng) obj;
			if (clazz.getBianHao().equals(this.getBianHao()))
				isEquals = true;
			return isEquals;
		}
		return isEquals;
	}

}